package org.bringer.service;

import java.util.List;

import org.bringer.dao.AccountDao;
import org.bringer.dao.SearchException;
import org.bringer.model.Account;
import org.bringer.service.exceptions.AccountExistsException;


/**
 * Business Service Interface to handle communication between web and
 * persistence layer.
 *
 * 
 */
public interface AccountManager extends GenericManager<Account, Long> {
    /**
     * Convenience method for testing - allows you to mock the DAO and set it on an interface.
     * @param accountDao the AccountDao implementation to use
     */
    void setAccountDao(AccountDao accountDao);

   
    Account getAccount(String accountId);
    Account getAccountByIban(String ibanCode);
   
    List<Account> getAccountsByUser(String userId) throws SearchException;

   
    List<Account> getAccountsByDescription(String desc) throws SearchException;

  
    Account saveAccount(Account account) throws AccountExistsException;

   
    void removeAccount(Account account);

    /**
     * Removes a user from the database by their userId
     *
     * @param iban the account iban id
     */
    void removeAccount(String ibanCode);
    /**
     * Removes a user from the database by their userId
     *
     * @param iban the account iban id
     */
    void removeAccount(long id);
    /**
     * Search a user for search terms.
     * @param searchTerm the search terms.
     * @return a list of matches, or all if no searchTerm.
     */
    List<Account> search(String searchTerm);
}
